package com.student.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PartyBuild entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Party_Build", schema = "dbo", catalog = "StudentManager")
public class PartyBuild implements java.io.Serializable {

	// Fields

	private Long partyBuildId;
	private Student student;
	private Timestamp partyGraduationTime;
	private String partyStatus;
	private Set<Student> students = new HashSet<Student>(0);

	// Constructors

	/** default constructor */
	public PartyBuild() {
	}

	/** minimal constructor */
	public PartyBuild(Long partyBuildId, String partyStatus) {
		this.partyBuildId = partyBuildId;
		this.partyStatus = partyStatus;
	}

	/** full constructor */
	public PartyBuild(Long partyBuildId, Student student,
			Timestamp partyGraduationTime, String partyStatus,
			Set<Student> students) {
		this.partyBuildId = partyBuildId;
		this.student = student;
		this.partyGraduationTime = partyGraduationTime;
		this.partyStatus = partyStatus;
		this.students = students;
	}

	// Property accessors
	@Id
	@Column(name = "Party_Build_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getPartyBuildId() {
		return this.partyBuildId;
	}

	public void setPartyBuildId(Long partyBuildId) {
		this.partyBuildId = partyBuildId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Student_id")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Column(name = "Party_Graduation_Time", length = 23)
	public Timestamp getPartyGraduationTime() {
		return this.partyGraduationTime;
	}

	public void setPartyGraduationTime(Timestamp partyGraduationTime) {
		this.partyGraduationTime = partyGraduationTime;
	}

	@Column(name = "Party_Status", nullable = false, length = 20)
	public String getPartyStatus() {
		return this.partyStatus;
	}

	public void setPartyStatus(String partyStatus) {
		this.partyStatus = partyStatus;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "partyBuild")
	public Set<Student> getStudents() {
		return this.students;
	}

	public void setStudents(Set<Student> students) {
		this.students = students;
	}

}